<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>悬浮对话框</title>
    <style>
        body{
            margin:0;
        }
        .dialog{
            position: fixed;
            height: 300px;
            width: 500px;
            background-color: #ff9e80;

            left:0;
            right:0;
            margin: 0 auto;
            top:200px;
            z-index: 1000;
        }
        .mask{
            background-color: black;
            position: fixed;
            left: 0;
            right:0;
            top:0;
            bottom: 0;
            opacity: 0.5;
            z-index: 999;
        }
    </style>
</head>
<body>
    <div style="height: 1000px">今天天气</div>
    <div class="mask"></div>
    <div class="dialog">你好</div>
</body>
</html>